\section{\large Illustrating Example}
\label{sec:example}


\newcommand\T{\rule{0pt}{2.6ex}}
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}}

\begin{figure}
\center
\begin{tabular}{ l | c | c |c |c}
  & \multicolumn{3}{c|}{Test cases} & Suspiciousness\\
  \cline{2-4}
  \quad & \CodeIn{arg1 = 1}, \CodeIn{arg2 = 2} & \CodeIn{arg1 = 2}, \CodeIn{arg2 = 2} & \CodeIn{arg1 = 2}, \CodeIn{arg2 = 1}  &  computed by~\cite{Jones02visualizationof}\\
  \hline
  \CodeIn{1. a = arg1; } & $\bullet$ &  $\bullet$& $\bullet$ & 0.5\\
  \cline{2-4}
  \CodeIn{2. b = arg2; } & $\bullet$ &  $\bullet$ & $\bullet$ & 0.5 \\
  \cline{2-4}
  \CodeIn{3. if(a >= b) \{} &  $\bullet$& $\bullet$ & $\bullet$ & 0.5\\
  \cline{2-4}
  \CodeIn{4.  \quad return b;} &  &  $\bullet$& $\bullet$ & 0.33\\
  \cline{2-4}
  \CodeIn{5. \} else \{} & $\bullet$ & & & 1.0\\
  \cline{2-4}
  \CodeIn{6.  \quad return a;} &  $\bullet$&  & & 1.0 \\
  \cline{2-4}
  \CodeIn{7. \}} &  &  & & \\
  \hline
  \quad\quad Pass/Fail Status & F & P & F & \\
\end{tabular}
\caption{\label{fig:larger} Example buggy program with 3 test cases and their coverage. The buggy line is 3, which should be \CodeIn{a < b}. A line covered by a test case is indicated by $\bullet$. The far right column shows the suspiciousness score computed by a state-of-the-art fault localization technique~\cite{Jones02visualizationof}, which incorrectly ranks lines 5 and 6 as the most likely buggy statement.}
\end{figure}

To best illustrate our technique, consider the erroneous program for determining the larger value of the two input values, as shown in Figure~\ref{fig:larger}. In this program, the buggy code is line 3, which should be replaced by \CodeIn{a < b}.

A well-established approach named Tarantula~\cite{Jones02visualizationof} localizes the potential buggy statements by computing a suspiciousness score of each statement $s$ using the following equation:

\[
suspiciousness(s) = \frac{\%Failed(s)}{\%Failed(s) + \%Passed(s)}
\]

A statement with a high suspiciousness score indicates it is more
likely to be a buggy statement. However, as shown by the far right
column in Figure~\ref{fig:larger}, this technique incorrectly
assigns the highest suspiciousness score to lines 5 and 6. Even
worse, it assigns a lowest score to line 4 indicating it is the least likely
line to be buggy, and the same suspiciousness score to lines 1 - 3,
indicating they are equally likely to be buggy.

A root cause of such imprecision is because the Tarantula approach
assumes that each statement in the tested program is
\textit{independent} with one another.

\vspace{1mm}

Our new bug localization technique based on the MLN interface layer can
easily remedy this problem by providing the \textit{control flow dependence}
and \textit{data flow dependence} rules as presented in Section~\ref{sec:model}. The Markov Logic Network based model solves this issue by
building dependencies between statements. For this example in
Figure~\ref{fig:larger}, the suspiciousness of statement 5 and 6
will be reduced because there is control dependency between $s_3$ ,
$s_5$ and $s_6$. By assigning false to $s_3$ but true to $s_5$ and
$s_6$, the MLN system can gain weight of
Equation~\ref{eq_controldep}.
